//
// Created by fins on 24-9-28.
//

#ifndef CLOUD_FILTER_VISUALIZE_CLOUD_HPP
#define CLOUD_FILTER_VISUALIZE_CLOUD_HPP

#include <visualization_msgs/msg/marker.hpp>
#include <rclcpp/rclcpp.hpp>
#include <vector>
#include <string>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <geometry_msgs/msg/point_stamped.hpp>
#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
#include <visualization_msgs/msg/marker.hpp>
#include <yaml-cpp/yaml.h>
#include <fstream>
/***
 * Box_t: Box data structure
 * @member minPoint: Minimum point
 * @member maxPoint: Maximum point
 */
struct Box_t {
    std::vector<double> minPoint;
    std::vector<double> maxPoint;
};

/***
 * MarkerViz: Visualize marker
 * @function loadBoxDimensions: Load box dimensions
 * @function visualize: Visualize marker
 */
class MarkerViz : public rclcpp::Node {
public:
    MarkerViz(const std::string &name);
    void loadBoxDimensions();
    void visualize();

private:
    visualization_msgs::msg::Marker marker;
    rclcpp::Publisher<visualization_msgs::msg::Marker>::SharedPtr pub_marker;
    Box_t box;

    YAML::Node config;
    double min_x, min_y, min_z, max_x, max_y, max_z;
    std::string use_marker;
    rclcpp::TimerBase::SharedPtr timer_;

};

#endif // CLOUD_FILTER_VISUALIZE_CLOUD_HPP
